package q10.unittests;
import q10.Arbori.*;
import q10.Functii.FunctiiElementare.*;


import junit.framework.TestCase;

public class ExpTest extends TestCase {

	private Nod n;
	private Nod nec=new Necunoscuta();
	public static final double E=Math.E;
	
	protected void setUp() throws Exception {
	    n = new Exp();
		n.setfStang(nec);
	}

	protected void tearDown() throws Exception {
		n=null;
	}

	public void testCalcul() {
		double rez=Math.pow(E, this.n.getX());
		assertEquals(rez,this.n.calcul());
		
	}

	public void testDerivare() {
		String expected="e^"+this.n.getfStang()+" * ln("+this.n.getfStang()+")";
		assertEquals(expected,n.derivare());
	}

	public void testCalculDerivata() {
		double rez=nec.calcul()*nec.calculDerivata();
		assertEquals(rez,n.calculDerivata());
	}

	public void testToString() {
		String rez="e^"+this.n.getfStang();
		assertEquals(rez,n.toString());
	}

	public void testGetfStang() {
		assertEquals(n.getfStang(),this.n.getfStang());
	}



}
